//
//  DetailedFirstModel.m
//  NBTripe
//
//  Created by 陈曦 on 16/1/11.
//  Copyright © 2016年 Vicki. All rights reserved.
//

#import "DetailedFirstModel.h"

@implementation DetailedFirstModel
- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"description"]) {
        self.descriptions = value;
    }
    if ([key isEqualToString:@"abstract"]) {
        NSMutableArray *mutableArray = [NSMutableArray arrayWithCapacity:0];
        for (NSDictionary *dic in value) {
            AbstractModel *dataModel = [[AbstractModel alloc] initWithDataSource:dic];
            [mutableArray addObject:dataModel];
        }
        self.abstractArray = [NSArray arrayWithArray:mutableArray];
    }
    if ([key isEqualToString:@"tools"]) {
        NSMutableArray *mutableArray = [NSMutableArray arrayWithCapacity:0];
        for (NSDictionary *dic in value) {
            ToolsModel *dataModel = [[ToolsModel alloc] initWithDataSource:dic];
            [mutableArray addObject:dataModel];
        }
        self.toolsArray = [NSArray arrayWithArray:mutableArray];
    }
    if ([key isEqualToString:@"hottest_sites"]) {
        NSMutableArray *mutableArray = [NSMutableArray arrayWithCapacity:0];
        for (NSDictionary *dic in value) {
            HottestSitesModel *dataModel = [[HottestSitesModel alloc] initWithDataSource:dic];
            [mutableArray addObject:dataModel];
        }
        self.hottest_sitesArray = [NSArray arrayWithArray:mutableArray];
    }
    if ([key isEqualToString:@"hottest_places"]) {
        NSMutableArray *mutableArray = [NSMutableArray arrayWithCapacity:0];
        for (NSDictionary *dic in value) {
            HottestPlacesModel *dataModel = [[HottestPlacesModel alloc] initWithDataSource:dic];
            [mutableArray addObject:dataModel];
        }
        self.hottest_placesArray = [NSArray arrayWithArray:mutableArray];
    }
    if ([key isEqualToString:@"country"]) {
        self.countrys = [[CountryModel alloc] initWithDataSource:value];
    }
    if ([key isEqualToString:@"id"]) {
        self.nId = value;
    }
    
}

@end


